<h1>Draws</h1>

<cfoutput query="fixtures" group="roundNo">
	<h3>Round #RoundNo#</h3>
	<cfoutput>
	
	<!--- Work out specifics --->
	<cfset resultInWords = "vs">
	<cfset showResult = false>
	<cfif homeTeamScore GT 2 AND awayTeamScore GT 2>
		<cfset showResult = true>
		<cfset resultInWords = "defeated">
		<cfif homeTeamScore LT awayTeamScore>
			<cfset resultInWords = "lost to">
		</cfif>
	</cfif>
	
	<table>
		<tr>
			<td>
				<cfset homeTeam = model("Team").findByKey(key=hometeamid,select="TeamName")>
				#hometeamid#. #homeTeam.TeamName#
				<cfif showResult>
					[#hometeamscore#]
				</cfif>
			</td>

			<td>
				#resultInWords#				
			</td>
			
			<td>
				<cfset awayTeam = model("Team").findByKey(key=awayteamid,select="TeamName")>
				#awayteamid#. #awayTeam.TeamName#
				<cfif showResult>
					[#awayteamscore#]
				</cfif>
			</td>
		</tr>
	</table>
	</cfoutput>
</cfoutput>

